<%--
  Created by IntelliJ IDEA.
  User: adminthy
  Date: 2018/6/17
  Time: 16:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="css/login.css"/>
    <title>EasyMall欢迎您登陆</title>
    <style>
        .error-msg{
            color: red;
            text-align: center;
        }
    </style>
</head>
<body>
<h1>欢迎登陆EasyMall</h1>
<form action="${app}/LoginServlet" method="POST">
    <table>
        
        <c:if test="${not empty param.username}" var="isUsername">
            <c:set var="username" value="${param.username}" scope="request"></c:set>
        </c:if>
        <c:if test="${!isUsername}">
            <c:set var="username" value="${cookie.remname.value}" scope="request"></c:set>
        </c:if>

        <c:if test="${not empty requestScope.errorMsg.all[0]}">
            <tr>
                <td class="tdx" colspan="2">
                    <div class="error-msg">${requestScope.errorMsg.all[0]}</div>
                </td>
            </tr>
        </c:if>
        <tr>
            <td class="tdx">用户名：</td>
            <td>
                <input type="text" name="username" value="${username}"/>
                <span class="error-msg">${requestScope.errorMsg.username[0]}</span>
            </td>

        </tr>
        <tr>
            <td class="tdx">密&nbsp;&nbsp; 码：</td>
            <td>
                <input type="password" name="password"/>
                <span class="error-msg">${requestScope.errorMsg.password[0]}</span>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="checkbox" name="remname" value="true" <c:if test="${not empty username}">checked</c:if>  />记住用户名
                <input type="checkbox" name="autologin" value="true" />30天内自动登陆
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center">
                <input type="submit" value="登 陆"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
